package com.deyuanyun.pic.settings.controller.dto.base;

import org.apache.commons.lang.builder.ToStringBuilder;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

/**
 *  管道管段任务周期实体类
 *  @author axiao(xj08.dream@gmail.com)
 *  @date 2016-06-29
 *  @version 1.0
 *  Histroy: [修改人][时间][描述]
 */
public class PipeScheduleVO implements Serializable {

    private static final long serialVersionUID = -1517821071346256479L;
    private String pipeLineId;//管道id
    private String pipeLineName;//管道名称

    private String pipeSegmentId; //管段id
    private String pipeSegmentName; //管段名称

    private String beginMileageId; //起始绝对距离id
    private String endMileageId; //终止绝对距离id
    private BigDecimal beginMileage;//起始绝对距离
    private BigDecimal endMileage;//终止绝对距离
    private String beginName; //起点位置名称
    private String endName; //终点位置名称

    private String firstTime; //初次评价时间(年月为单位)
    private int cycle; //间隔周期(月为单位)
    private int advance; //提前天数
    private int order; //顺序
    private String roleId;//角色id
    private Date startDate;//初次通知时间

    public String getPipeLineId() {
        return pipeLineId;
    }

    public void setPipeLineId(String pipeLineId) {
        this.pipeLineId = pipeLineId;
    }

    public String getPipeLineName() {
        return pipeLineName;
    }

    public void setPipeLineName(String pipeLineName) {
        this.pipeLineName = pipeLineName;
    }

    public String getPipeSegmentId() {
        return pipeSegmentId;
    }

    public void setPipeSegmentId(String pipeSegmentId) {
        this.pipeSegmentId = pipeSegmentId;
    }

    public String getPipeSegmentName() {
        return pipeSegmentName;
    }

    public void setPipeSegmentName(String pipeSegmentName) {
        this.pipeSegmentName = pipeSegmentName;
    }

    public String getBeginMileageId() {
        return beginMileageId;
    }

    public void setBeginMileageId(String beginMileageId) {
        this.beginMileageId = beginMileageId;
    }

    public String getEndMileageId() {
        return endMileageId;
    }

    public void setEndMileageId(String endMileageId) {
        this.endMileageId = endMileageId;
    }

    public BigDecimal getBeginMileage() {
        return beginMileage;
    }

    public void setBeginMileage(BigDecimal beginMileage) {
        this.beginMileage = beginMileage;
    }

    public BigDecimal getEndMileage() {
        return endMileage;
    }

    public void setEndMileage(BigDecimal endMileage) {
        this.endMileage = endMileage;
    }

    public String getBeginName() {
        return beginName;
    }

    public void setBeginName(String beginName) {
        this.beginName = beginName;
    }

    public String getEndName() {
        return endName;
    }

    public void setEndName(String endName) {
        this.endName = endName;
    }

    public String getFirstTime() {
        return firstTime;
    }

    public void setFirstTime(String firstTime) {
        this.firstTime = firstTime;
    }

    public int getCycle() {
        return cycle;
    }

    public void setCycle(int cycle) {
        this.cycle = cycle;
    }

    public int getAdvance() {
        return advance;
    }

    public void setAdvance(int advance) {
        this.advance = advance;
    }

    public int getOrder() {
        return order;
    }

    public void setOrder(int order) {
        this.order = order;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    /**
     * 得到角色id集合信息
     * @return
     */
    public List<String> getRoleIdList(){
        if(roleId == "" || roleId == null) {
            return new ArrayList<String>();
        }
        String roleIds[] = roleId.split(",");
        return Arrays.asList(roleIds);
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("PipeScheduleVO{");
        sb.append("pipeLineId='").append(pipeLineId).append('\'');
        sb.append(", pipeLineName='").append(pipeLineName).append('\'');
        sb.append(", pipeSegmentId='").append(pipeSegmentId).append('\'');
        sb.append(", pipeSegmentName='").append(pipeSegmentName).append('\'');
        sb.append(", beginMileageId='").append(beginMileageId).append('\'');
        sb.append(", endMileageId='").append(endMileageId).append('\'');
        sb.append(", beginMileage=").append(beginMileage);
        sb.append(", endMileage=").append(endMileage);
        sb.append(", beginName='").append(beginName).append('\'');
        sb.append(", endName='").append(endName).append('\'');
        sb.append(", firstTime='").append(firstTime).append('\'');
        sb.append(", cycle=").append(cycle);
        sb.append(", advance=").append(advance);
        sb.append(", order=").append(order);
        sb.append(", roleId='").append(roleId).append('\'');
        sb.append(", startDate=").append(startDate);
        sb.append('}');
        return sb.toString();
    }
}
